$(function () {
    var eid = GetQueryString("eid");
    var sel = $.Params.create();
    sel.ajax("get", getAdminIP() + "pfMeets/" + eid, function (data) {
        if (data.success) {
            var val = data.result;
            $("#title").val(val.title);
            $("#meetTime").val(val.meetTime);
            $("#meetNum").val(val.meetNum);
            $("#lead").val(val.lead);
            $("#hourRecord").val(val.hourRecord);
        } else {
            alert(data.msg);
        }
    })



    $("#addData").on("click", function () {
        var title = $("#title").val();
        var meetTime = $("#meetTime").val();
        var lead = $("#lead").val();
        var meetNum = $("#meetNum").val();
        var hourRecord = $("#hourRecord").val();
        if (title == "") {
            alert("会议标题不能为空！");
            return false;
        }
        var addSel = $.Params.create();
        addSel.addParams("title", title);
        addSel.addParams("meetTime", meetTime);
        addSel.addParams("lead", lead);
        addSel.addParams("meetNum", meetNum);
        addSel.addParams("hourRecord", hourRecord);
        addSel.ajax("put", getAdminIP() + "pfMeets/" + eid, function (data) {
            if (data.success) {
                window.location.href = "pfMeetList.html";
            } else {
                alert(data.msg);
            }
        })
    })

    $("#cancelAdd").on("click", function () {
        history.go(-1);
    })
})